<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateProjectTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('project', function (Blueprint $table) {
            $table->increments('id')->comment('自增ID');
            $table->string('title',20)->comment('项目标题')->index();
            $table->mediumtext('content')->comment('项目简介');
            $table->mediumtext('progress')->comment('项目进展');
            $table->tinyInteger('project_type')->comment('项目类型');
            $table->tinyInteger('donation')->comment('捐款方式');
            $table->decimal('money',10,2)->comment('捐款金额');
            $table->string('province',20)->comment('省份');
            $table->string('city',20)->comment('市')->index();
            $table->string('district',20)->comment('县区');
            $table->string('location',100)->comment('项目详细地址');
            $table->string('group_id',100)->comment('所属机构')->index();
            $table->string('cover',100)->comment('封面图');
            $table->string('qrcode',100)->comment('二维码');
            $table->timestamp('end_time')->comment('结束时间');
            $table->string('liable',30)->comment('联系人,负责人');
            $table->string('mobile',45)->comment('项目联系方式');
            $table->tinyInteger('grade')->comment('项目等级');
            $table->tinyInteger('status')->comment('审核状态');
            $table->string('reason',80)->comment('拒绝原因');
            $table->integer('number')->comment('参加总人数');
            $table->integer('sort')->comment('排序');
            $table->integer('money_ratio')->comment('提现');
            $table->integer('match_ratio')->comment('配捐比例');
            $table->integer('match_firm')->comment('配捐企业');
            $table->integer('project_book')->comment('项目书');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('project');
    }
}
